package org.yray.io.rocketmqdemo.listener;

import com.alibaba.fastjson.JSON;
import org.apache.rocketmq.spring.core.RocketMQListener;

public abstract class  BaseMQListener<T> implements RocketMQListener<String> {


    abstract public void onRecv(T body);

    @Override
    public void onMessage(String strMsg)
    {
        BaseMqMsg baseMqMsg=JSON.parseObject(strMsg, BaseMqMsg.class);
        onRecv((T)baseMqMsg.getBody());
    }

}
